Skip to content

Conversation

markhoangcll
Copy link

@markhoangcll markhoangcll commented Sep 15, 2025

Closes OPDATA-4029 / CM-1099

Description

LiveArt External Adapter (EA) to fetch art nav_per_share numerical data.
......

Changes

  • Created EA
  • Wrote integration and unit tests
  • Generated a changeset

Steps to Test

From root directory

  1. yarn setup
  2. export adapter=liveart
  3. yarn test $adapter/test

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file or update the soak testing blacklist.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

Copy link

changeset-bot bot commented Sep 15, 2025

🦋 Changeset detected

Latest commit: e4bb691

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@chainlink/liveart-external-adapter Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markhoangcll markhoangcll marked this pull request as draft September 15, 2025 09:33
Comment on lines +9 to +13
API_BASE_URL: {
description: 'The API URL for the LiveArt data provider',
type: 'string',
required: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put a default url here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is a defaultURL? is that just a base url?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can put a default value here so NOPs won't have to configure it individually

Comment on lines +3 to +6
export type Config = {
API_BASE_URL: string
BEARER_TOKEN: string
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where else would i be able to define secrets to be pulled into the ea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've never had the need to define a structure like it. You should be able to access it via the existing config structure

@@ -0,0 +1,9 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a tsconfig.test.json

as well as these two file under root

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what other files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/tsconfig.json and another one for test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/tsconfig.json and another one for test

@@ -0,0 +1,88 @@
import nock from 'nock'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to integration test folder

const data = { artwork_id: 'banksy' }
const params = [data]
const mockResponseData: ResponseSchema = {
...SuccessResponse,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to mock the entire thing here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont have to but its good practice as we would 100% recreate production request/response.

}
}

export function createMockResponse(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel this is neceessary

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this to test my parseResponse function and to not have type warnings. How differently would you do it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use

{
    data,
    status,
    statusText,
    headers: {},
    config: {} as any,
  }

You can do as any as your are already doing to remove warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants